using System.IO;
using System.IO.Ports;
using com.tc.gateway.serial;
namespace com.tc.serial
{


    public class WinSerialStream : SerialStream
    {
        SerialPort serialPort;
        public WinSerialStream(string port)
        {
            serialPort = new System.IO.Ports.SerialPort(port);
            serialPort.Open();
        }
        /* (non-Javadoc)
         * @see com.tc.serial.SerialStream#getInputStream()
         */
        public Stream getInputStream()
        {

            return this.serialPort.BaseStream;

        }
        /* (non-Javadoc)
         * @see com.tc.serial.SerialStream#getOutputStream()
         */
        public Stream getOutputStream()
        {
            return this.serialPort.BaseStream;
        }

        /* (non-Javadoc)
         * @see com.tc.serial.SerialStream#ClosePort()
         */
        public void ClosePort()
        {

            serialPort.Close();
        }

    }
}
